import javax.swing.JPanel;
import java.awt.Frame;
import java.awt.BorderLayout;

import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JEditorPane;
import javax.swing.JScrollPane;
import java.awt.Dimension;

public class UrlVisualizar extends JDialog {

	private static final long serialVersionUID = 1L;

	private JPanel jContentPane = null;

	private JEditorPane jEditorPane = null;
	
	private History H;

	private JScrollPane jScrollPane = null;

	/**
	 * @param owner
	 */
	public UrlVisualizar(History his) {
		super();
		
		ImageIcon icone = new ImageIcon("Photos\\lince2.jpg"); // adiciona
		// icone na
		// janela
		setIconImage(icone.getImage());
		
		
		this.H=his;
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(319, 200);
		this.setContentPane(getJContentPane());
		this.setTitle("Lince - All Url's");
		this.setLocationRelativeTo(null);
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jContentPane = new JPanel();
			jContentPane.setLayout(new BorderLayout());
			jContentPane.add(getJScrollPane(), BorderLayout.CENTER);
		}
		return jContentPane;
	}

	/**
	 * This method initializes jEditorPane	
	 * 	
	 * @return javax.swing.JEditorPane	
	 */
	private JEditorPane getJEditorPane() {
		if (jEditorPane == null) {
			jEditorPane = new JEditorPane();
			
			jEditorPane.setEditable(false);
			jEditorPane.setText("All Url's : \n");
			
			String conteudo="";
			for(int i=0;i<H.Lurl.size();i++)
				conteudo = conteudo + H.Lurl.get(i).nome + "\n";
				
			jEditorPane.setText(conteudo);		
		}
		return jEditorPane;
	}

	/**
	 * This method initializes jScrollPane	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	private JScrollPane getJScrollPane() {
		if (jScrollPane == null) {
			jScrollPane = new JScrollPane();
			jScrollPane.setViewportView(getJEditorPane());
		}
		return jScrollPane;
	}

}  //  @jve:decl-index=0:visual-constraint="10,10"
